#include <QDebug>
#include <time.h>
#include <QTime>
#include <QWidget>
#include <QtXml>
#include <QDomDocument>
#include <QDomElement>
#include <QDomNode>
#include <QXmlStreamReader>
#include <QFile>
#include <QFileDialog>
#include <QTreeWidget>
#include <QTextEdit>
#include <QByteArray>

#include "unionrobcontrollerhmiinstance.h"
#include "Hmi/hmi.h"
#include "Backend/backend.h"

UnionRobControllerHMIInstance::UnionRobControllerHMIInstance(){
    this->pHmi = nullptr;
    this->pBackend = nullptr;

    if(this->pHmi == nullptr)
        this->pHmi = new Hmi();
    if(this->pBackend == nullptr)
        this->pBackend = new Backend();

    this->pHmi->pBackend = this->pBackend;
}

UnionRobControllerHMIInstance::~UnionRobControllerHMIInstance(){
    if(this->pHmi != nullptr)
        delete this->pHmi;
    if(this->pBackend != nullptr)
        delete this->pBackend;
}

QWidget* UnionRobControllerHMIInstance::getUiHandle(){
    if(this->pHmi != nullptr)
        return this->pHmi;
    else
        return this;
}





